<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{{.title}}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="/static/layui/css/layui.css?t=1604588872225" media="all">
    <style>
        .later {
            float: right;
            margin-bottom: 5px;
        }
        .later a,
        .later a:hover,
        .later a:visited {
            color: #f0f0f0;
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend>{{ .err }}</legend>
    </fieldset>
    <div class="layui-form" style="width: 80%;margin: auto;">
        <button type="submit" class="layui-btn later">
            <a href="/categories/new">新增分类</a>
        </button>
        <table class="layui-table">
            <thead>
            <tr>
                <th>ID</th>
                <th>名称</th>
                <th>排序</th>
                <th>创建时间</th>
                <th>更新时间</th>
                <th width="150">操作</th>
            </tr>
            </thead>
            <tbody>
            {{ range .list }}
                <tr>
                    <td>{{ .ID }}</td>
                    <td>{{ .Name }}</td>
                    <td>{{ .Sort }}</td>
                    <td>{{ .CreatedAt }}</td>
                    <td>{{ .UpdatedAt }}</td>
                    <td>
                        <a class="layui-btn layui-btn-xs" lay-event="edit" href="/categories/edit/{{ .ID }}">编辑</a>
                        <a class="layui-btn layui-btn-danger layui-btn-xs" href="/categories/delete/{{ .ID }}">删除</a>
                    </td>
                </tr>
            {{end}}
            </tbody>
        </table>
    </div>
</div>
<script src="/static/layui/layui.js?t=1604588872225" charset="utf-8"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;
    });
</script>
</body>
</html>
